package jdbc;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class jdbcdemo10
{
    public static void main(String[] args)
    {
        try (Connection con=DButil.getConnection())
        {
            String sql="UPDATE USER SET PASSWORD=? WHERE USERNAME=?";
            PreparedStatement ps=con.prepareStatement(sql);
            ps.setString(1,"000000");
            ps.setString(2,"JOJO");
            int count=ps.executeUpdate();
            System.out.println(count>0?"修改成功":"修改失败");

        } catch (SQLException e) {e.printStackTrace();}
    }
}
